{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "92604544",
   "metadata": {},
   "source": [
    "1."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "374dd543",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "0d245c34",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "87442\n",
      "        gaze_timestamp  world_index  confidence  norm_pos_x  norm_pos_y  \\\n",
      "21        88150.825638            2    0.915197    0.493612    0.398950   \n",
      "22        88150.827729            2    0.915197    0.493561    0.399305   \n",
      "23        88150.829663            2    0.915197    0.493570    0.399542   \n",
      "39        88150.866015            3    0.922197    0.492592    0.398705   \n",
      "40        88150.869620            3    0.922197    0.492635    0.398814   \n",
      "...                ...          ...         ...         ...         ...   \n",
      "125259    88443.695600         8788    0.995336    0.407831    0.413470   \n",
      "125260    88443.697570         8788    0.948733    0.407552    0.414731   \n",
      "125261    88443.701580         8788    0.945284    0.407467    0.414705   \n",
      "125262    88443.703608         8788    0.945284    0.407160    0.415340   \n",
      "125263    88443.705574         8788    0.945284    0.407637    0.413674   \n",
      "\n",
      "                                 base_data  gaze_point_3d_x  gaze_point_3d_y  \\\n",
      "21           88150.827729-0 88150.823548-1         2.412810       -21.468145   \n",
      "22           88150.827729-0 88150.827729-1         2.429837       -21.374413   \n",
      "23      88150.827729-0 88150.83159799999-1         2.427118       -21.328193   \n",
      "39      88150.867514-0 88150.86451599999-1         2.827911       -21.750938   \n",
      "40           88150.867514-0 88150.871726-1         2.813774       -21.744854   \n",
      "...                                    ...              ...              ...   \n",
      "125259        88443.69561-0 88443.695591-1       327.648915      -173.027524   \n",
      "125260   88443.69561-0 88443.69953099999-1       311.054477      -161.381388   \n",
      "125261  88443.703629-0 88443.69953099999-1       313.566509      -162.585330   \n",
      "125262       88443.703629-0 88443.703587-1       297.019831      -152.352987   \n",
      "125263  88443.703629-0 88443.70751899999-1       323.629974      -170.142461   \n",
      "\n",
      "        gaze_point_3d_z  eye_center0_3d_x  ...  eye_center0_3d_z  \\\n",
      "21          -295.071057         20.000000  ...        -20.000000   \n",
      "22          -294.819200         20.000000  ...        -20.000000   \n",
      "23          -294.874516         20.000000  ...        -20.000000   \n",
      "39          -298.233245         20.000000  ...        -20.000000   \n",
      "40          -298.471253         20.000000  ...        -20.000000   \n",
      "...                 ...               ...  ...               ...   \n",
      "125259     -2777.243340         19.888755  ...        -20.707271   \n",
      "125260     -2628.637408         19.888755  ...        -20.707271   \n",
      "125261     -2647.420719         19.888755  ...        -20.707271   \n",
      "125262     -2499.428189         19.888755  ...        -20.707271   \n",
      "125263     -2737.404466         19.888755  ...        -20.707271   \n",
      "\n",
      "        gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  eye_center1_3d_x  \\\n",
      "21            0.062883        0.025100        0.997705        -39.934928   \n",
      "22            0.062883        0.025100        0.997705        -39.934928   \n",
      "23            0.062883        0.025100        0.997705        -39.934928   \n",
      "39            0.060717        0.025220        0.997836        -39.934928   \n",
      "40            0.060717        0.025220        0.997836        -39.934928   \n",
      "...                ...             ...             ...               ...   \n",
      "125259       -0.110854        0.041843        0.992955        -37.372594   \n",
      "125260       -0.110854        0.041843        0.992955        -37.372594   \n",
      "125261       -0.111009        0.041794        0.992940        -37.372594   \n",
      "125262       -0.111009        0.041794        0.992940        -37.372594   \n",
      "125263       -0.111009        0.041794        0.992940        -37.372594   \n",
      "\n",
      "        eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  gaze_normal1_y  \\\n",
      "21             14.997919        -20.075283       -0.150041        0.234536   \n",
      "22             14.997919        -20.075283       -0.150243        0.234115   \n",
      "23             14.997919        -20.075283       -0.150210        0.233747   \n",
      "39             14.997919        -20.075283       -0.149814        0.233510   \n",
      "40             14.997919        -20.075283       -0.149645        0.233258   \n",
      "...                  ...               ...             ...             ...   \n",
      "125259         14.763454        -23.294339       -0.130868        0.093021   \n",
      "125260         14.763454        -23.294339       -0.132037        0.091860   \n",
      "125261         14.763454        -23.294339       -0.132037        0.091860   \n",
      "125262         14.763454        -23.294339       -0.133311        0.091656   \n",
      "125263         14.763454        -23.294339       -0.131320        0.092941   \n",
      "\n",
      "        gaze_normal1_z  \n",
      "21            0.960458  \n",
      "22            0.960530  \n",
      "23            0.960624  \n",
      "39            0.960744  \n",
      "40            0.960831  \n",
      "...                ...  \n",
      "125259        0.987026  \n",
      "125260        0.986979  \n",
      "125261        0.986979  \n",
      "125262        0.986827  \n",
      "125263        0.986974  \n",
      "\n",
      "[87442 rows x 21 columns]\n"
     ]
    }
   ],
   "source": [
    "df = pd.read_csv('/Users/zhengqijia/Downloads/gaze.csv')\n",
    "def confidence(c):\n",
    "    return c >= 0.9\n",
    "df=df.loc[df['confidence'].apply(confidence)]\n",
    "print(df.shape[0])\n",
    "print(df)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "12010064",
   "metadata": {},
   "source": [
    "2."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "78d741a1",
   "metadata": {},
   "outputs": [],
   "source": [
    "#默认在第一题基础上筛选数据\n",
    "sigma_x=df['norm_pos_x'].var()\n",
    "sigma_y=df['norm_pos_y'].var()\n",
    "mean_x=df['norm_pos_x'].mean()\n",
    "mean_y=df['norm_pos_y'].mean()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "b284bcaf",
   "metadata": {},
   "outputs": [],
   "source": [
    "min_x=mean_x-3*sigma_x\n",
    "max_x=mean_x+3*sigma_x\n",
    "min_y=mean_y-3*sigma_y\n",
    "max_y=mean_y+3*sigma_y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "b8e6eb2e",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "2030\n",
      "        gaze_timestamp  world_index  confidence  norm_pos_x  norm_pos_y  \\\n",
      "529       88152.059441           39    0.936205    0.398812    0.415605   \n",
      "530       88152.061923           39    0.936205    0.398967    0.415841   \n",
      "531       88152.064382           39    0.938704    0.398925    0.415342   \n",
      "532       88152.067930           39    0.938704    0.399004    0.415731   \n",
      "566       88152.145476           42    0.904104    0.397420    0.415351   \n",
      "...                ...          ...         ...         ...         ...   \n",
      "125257    88443.692745         8788    0.938922    0.407324    0.414699   \n",
      "125258    88443.694169         8788    0.999135    0.407554    0.413293   \n",
      "125260    88443.697570         8788    0.948733    0.407552    0.414731   \n",
      "125261    88443.701580         8788    0.945284    0.407467    0.414705   \n",
      "125262    88443.703608         8788    0.945284    0.407160    0.415340   \n",
      "\n",
      "                                 base_data  gaze_point_3d_x  gaze_point_3d_y  \\\n",
      "529     88152.059419-0 88152.05946399999-1      -614.974842       288.515053   \n",
      "530     88152.064382-0 88152.05946399999-1      -627.889437       294.199480   \n",
      "531          88152.064382-0 88152.064382-1      -637.325582       300.267015   \n",
      "532          88152.064382-0 88152.071478-1      -619.299497       290.660181   \n",
      "566     88152.147388-0 88152.14356499999-1      -577.986262       268.285258   \n",
      "...                                    ...              ...              ...   \n",
      "125257       88443.692747-0 88443.692744-1       322.200887      -166.814138   \n",
      "125258       88443.692747-0 88443.695591-1       336.831550      -177.706680   \n",
      "125260   88443.69561-0 88443.69953099999-1       311.054477      -161.381388   \n",
      "125261  88443.703629-0 88443.69953099999-1       313.566509      -162.585330   \n",
      "125262       88443.703629-0 88443.703587-1       297.019831      -152.352987   \n",
      "\n",
      "        gaze_point_3d_z  eye_center0_3d_x  ...  eye_center0_3d_z  \\\n",
      "529         4748.097241         20.000000  ...        -20.000000   \n",
      "530         4855.216665         20.000000  ...        -20.000000   \n",
      "531         4926.136171         20.000000  ...        -20.000000   \n",
      "532         4790.572508         20.000000  ...        -20.000000   \n",
      "566         4401.939117         20.000000  ...        -20.000000   \n",
      "...                 ...               ...  ...               ...   \n",
      "125257     -2716.113303         19.888755  ...        -20.707271   \n",
      "125258     -2846.522639         19.888755  ...        -20.707271   \n",
      "125260     -2628.637408         19.888755  ...        -20.707271   \n",
      "125261     -2647.420719         19.888755  ...        -20.707271   \n",
      "125262     -2499.428189         19.888755  ...        -20.707271   \n",
      "\n",
      "        gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  eye_center1_3d_x  \\\n",
      "529          -0.131778        0.071579        0.988692        -39.934928   \n",
      "530          -0.131510        0.071395        0.988741        -39.934928   \n",
      "531          -0.131510        0.071395        0.988741        -39.934928   \n",
      "532          -0.131510        0.071395        0.988741        -39.934928   \n",
      "566          -0.133783        0.070785        0.988480        -39.934928   \n",
      "...                ...             ...             ...               ...   \n",
      "125257       -0.111356        0.041812        0.992901        -37.372594   \n",
      "125258       -0.111356        0.041812        0.992901        -37.372594   \n",
      "125260       -0.110854        0.041843        0.992955        -37.372594   \n",
      "125261       -0.111009        0.041794        0.992940        -37.372594   \n",
      "125262       -0.111009        0.041794        0.992940        -37.372594   \n",
      "\n",
      "        eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  gaze_normal1_y  \\\n",
      "529            14.997919        -20.075283       -0.119526        0.042037   \n",
      "530            14.997919        -20.075283       -0.119526        0.042037   \n",
      "531            14.997919        -20.075283       -0.119698        0.042837   \n",
      "532            14.997919        -20.075283       -0.119364        0.042105   \n",
      "566            14.997919        -20.075283       -0.120578        0.042643   \n",
      "...                  ...               ...             ...             ...   \n",
      "125257         14.763454        -23.294339       -0.131841        0.091543   \n",
      "125258         14.763454        -23.294339       -0.130868        0.093021   \n",
      "125260         14.763454        -23.294339       -0.132037        0.091860   \n",
      "125261         14.763454        -23.294339       -0.132037        0.091860   \n",
      "125262         14.763454        -23.294339       -0.133311        0.091656   \n",
      "\n",
      "        gaze_normal1_z  \n",
      "529           0.991941  \n",
      "530           0.991941  \n",
      "531           0.991886  \n",
      "532           0.991957  \n",
      "566           0.991787  \n",
      "...                ...  \n",
      "125257        0.987035  \n",
      "125258        0.987026  \n",
      "125260        0.986979  \n",
      "125261        0.986979  \n",
      "125262        0.986827  \n",
      "\n",
      "[2030 rows x 21 columns]\n"
     ]
    }
   ],
   "source": [
    "def dele_x(a):\n",
    "    return a < max_x and a>min_x\n",
    "def dele_y(b):\n",
    "    return b < max_y and b > min_y\n",
    "df=df.loc[df['norm_pos_x'].apply(dele_x)]\n",
    "df=df.loc[df['norm_pos_y'].apply(dele_y)]\n",
    "print(df.shape[0])\n",
    "print(df)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "44ceae49",
   "metadata": {},
   "source": [
    "3."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "id": "c2ca7a41",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "                            gaze_timestamp  world_index  confidence  \\\n",
      "529    1970-01-02 08:29:12.059441500+08:00           39    0.936205   \n",
      "530       1970-01-02 08:29:12.061923+08:00           39    0.936205   \n",
      "531       1970-01-02 08:29:12.064382+08:00           39    0.938704   \n",
      "532    1970-01-02 08:29:12.067929999+08:00           39    0.938704   \n",
      "566    1970-01-02 08:29:12.145476500+08:00           42    0.904104   \n",
      "...                                    ...          ...         ...   \n",
      "125257 1970-01-02 08:34:03.692745500+08:00         8788    0.938922   \n",
      "125258    1970-01-02 08:34:03.694169+08:00         8788    0.999135   \n",
      "125260 1970-01-02 08:34:03.697570500+08:00         8788    0.948733   \n",
      "125261    1970-01-02 08:34:03.701580+08:00         8788    0.945284   \n",
      "125262    1970-01-02 08:34:03.703608+08:00         8788    0.945284   \n",
      "\n",
      "        norm_pos_x  norm_pos_y                           base_data  \\\n",
      "529       0.398812    0.415605  88152.059419-0 88152.05946399999-1   \n",
      "530       0.398967    0.415841  88152.064382-0 88152.05946399999-1   \n",
      "531       0.398925    0.415342       88152.064382-0 88152.064382-1   \n",
      "532       0.399004    0.415731       88152.064382-0 88152.071478-1   \n",
      "566       0.397420    0.415351  88152.147388-0 88152.14356499999-1   \n",
      "...            ...         ...                                 ...   \n",
      "125257    0.407324    0.414699       88443.692747-0 88443.692744-1   \n",
      "125258    0.407554    0.413293       88443.692747-0 88443.695591-1   \n",
      "125260    0.407552    0.414731   88443.69561-0 88443.69953099999-1   \n",
      "125261    0.407467    0.414705  88443.703629-0 88443.69953099999-1   \n",
      "125262    0.407160    0.415340       88443.703629-0 88443.703587-1   \n",
      "\n",
      "        gaze_point_3d_x  gaze_point_3d_y  gaze_point_3d_z  eye_center0_3d_x  \\\n",
      "529         -614.974842       288.515053      4748.097241         20.000000   \n",
      "530         -627.889437       294.199480      4855.216665         20.000000   \n",
      "531         -637.325582       300.267015      4926.136171         20.000000   \n",
      "532         -619.299497       290.660181      4790.572508         20.000000   \n",
      "566         -577.986262       268.285258      4401.939117         20.000000   \n",
      "...                 ...              ...              ...               ...   \n",
      "125257       322.200887      -166.814138     -2716.113303         19.888755   \n",
      "125258       336.831550      -177.706680     -2846.522639         19.888755   \n",
      "125260       311.054477      -161.381388     -2628.637408         19.888755   \n",
      "125261       313.566509      -162.585330     -2647.420719         19.888755   \n",
      "125262       297.019831      -152.352987     -2499.428189         19.888755   \n",
      "\n",
      "        ...  eye_center0_3d_z  gaze_normal0_x  gaze_normal0_y  gaze_normal0_z  \\\n",
      "529     ...        -20.000000       -0.131778        0.071579        0.988692   \n",
      "530     ...        -20.000000       -0.131510        0.071395        0.988741   \n",
      "531     ...        -20.000000       -0.131510        0.071395        0.988741   \n",
      "532     ...        -20.000000       -0.131510        0.071395        0.988741   \n",
      "566     ...        -20.000000       -0.133783        0.070785        0.988480   \n",
      "...     ...               ...             ...             ...             ...   \n",
      "125257  ...        -20.707271       -0.111356        0.041812        0.992901   \n",
      "125258  ...        -20.707271       -0.111356        0.041812        0.992901   \n",
      "125260  ...        -20.707271       -0.110854        0.041843        0.992955   \n",
      "125261  ...        -20.707271       -0.111009        0.041794        0.992940   \n",
      "125262  ...        -20.707271       -0.111009        0.041794        0.992940   \n",
      "\n",
      "        eye_center1_3d_x  eye_center1_3d_y  eye_center1_3d_z  gaze_normal1_x  \\\n",
      "529           -39.934928         14.997919        -20.075283       -0.119526   \n",
      "530           -39.934928         14.997919        -20.075283       -0.119526   \n",
      "531           -39.934928         14.997919        -20.075283       -0.119698   \n",
      "532           -39.934928         14.997919        -20.075283       -0.119364   \n",
      "566           -39.934928         14.997919        -20.075283       -0.120578   \n",
      "...                  ...               ...               ...             ...   \n",
      "125257        -37.372594         14.763454        -23.294339       -0.131841   \n",
      "125258        -37.372594         14.763454        -23.294339       -0.130868   \n",
      "125260        -37.372594         14.763454        -23.294339       -0.132037   \n",
      "125261        -37.372594         14.763454        -23.294339       -0.132037   \n",
      "125262        -37.372594         14.763454        -23.294339       -0.133311   \n",
      "\n",
      "        gaze_normal1_y  gaze_normal1_z  \n",
      "529           0.042037        0.991941  \n",
      "530           0.042037        0.991941  \n",
      "531           0.042837        0.991886  \n",
      "532           0.042105        0.991957  \n",
      "566           0.042643        0.991787  \n",
      "...                ...             ...  \n",
      "125257        0.091543        0.987035  \n",
      "125258        0.093021        0.987026  \n",
      "125260        0.091860        0.986979  \n",
      "125261        0.091860        0.986979  \n",
      "125262        0.091656        0.986827  \n",
      "\n",
      "[2030 rows x 21 columns]\n"
     ]
    }
   ],
   "source": [
    "#继续在第一题基础上\n",
    "df['gaze_timestamp']=pd.to_datetime(df['gaze_timestamp'].values,utc=True,unit='s').tz_convert('Asia/Shanghai')\n",
    "print(df)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "07571bc7",
   "metadata": {},
   "source": [
    "4."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "0ab619bf",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "427.62610766083765fs\n"
     ]
    }
   ],
   "source": [
    "df1 = pd.read_csv('/Users/zhengqijia/Downloads/gaze.csv')\n",
    "t=[]\n",
    "for i in df1['gaze_timestamp']:\n",
    "    t.append(i)\n",
    "time=t[-1]-t[0]\n",
    "# print(time,len(t))\n",
    "x=len(t)/(time)\n",
    "print(str(x)+'fs')"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "86979d22",
   "metadata": {},
   "source": [
    "5."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "id": "8e231cd0",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "    gaze_timestamp  world_index  confidence  norm_pos_x  norm_pos_y  \\\n",
      "0      88150.77678            0    0.828006    0.531433    0.397509   \n",
      "1      88150.78678            0    0.459705    0.337051    0.186147   \n",
      "2      88150.79678            0    0.888789    0.543140    0.410668   \n",
      "3      88150.80678            0    0.550258    0.337923    0.173301   \n",
      "4      88150.81678            1    0.502595    0.340109    0.142989   \n",
      "5      88150.82678            1    0.625134    0.484139    0.385491   \n",
      "6      88150.83678            1    0.625134    0.489687    0.392849   \n",
      "7      88150.84678            1    0.625134    0.495993    0.399021   \n",
      "8      88150.85678            1    0.706355    0.493975    0.408429   \n",
      "9      88150.86678            1    0.708476    0.494116    0.407109   \n",
      "10     88150.87678            1    0.708476    0.495145    0.408338   \n",
      "11     88150.88678            1    0.839662    0.495216    0.403442   \n",
      "12     88150.89678            1    0.791032    0.494728    0.405146   \n",
      "13     88150.90678            1    0.856341    0.494777    0.404969   \n",
      "14     88150.91678            1    0.856341    0.494888    0.402216   \n",
      "15     88150.92678            2    0.856341    0.494809    0.402125   \n",
      "16     88150.93678            2    0.716398    0.494057    0.401233   \n",
      "17     88150.94678            2    0.836166    0.493629    0.400583   \n",
      "18     88150.95678            2    0.836166    0.493772    0.400270   \n",
      "19     88150.96678            2    0.861113    0.493453    0.399839   \n",
      "\n",
      "                                  base_data  gaze_point_3d_x  gaze_point_3d_y  \\\n",
      "0                             88150.77678-0        28.369753        52.033135   \n",
      "1                            88150.776787-1      -142.869866       154.788121   \n",
      "2                            88150.779709-0        38.942051        45.359863   \n",
      "3                            88150.779759-1      -141.879169       160.867779   \n",
      "4                            88150.787485-1      -139.404860       175.088321   \n",
      "5   88150.78368299999-0 88150.79147699999-1         6.784204       -27.550520   \n",
      "6        88150.787484-0 88150.79147699999-1         4.180437       -24.431546   \n",
      "7         88150.79569-0 88150.79147699999-1         1.533100       -21.730862   \n",
      "8              88150.79569-0 88150.795675-1         2.226758       -19.036160   \n",
      "9              88150.79569-0 88150.801123-1         2.179629       -19.354530   \n",
      "10            88150.801157-0 88150.801123-1         1.782444       -18.930993   \n",
      "11             88150.801157-0 88150.80479-1         1.757366       -19.951730   \n",
      "12             88150.804471-0 88150.80479-1         1.944664       -19.682136   \n",
      "13             88150.809749-0 88150.80479-1         1.925755       -19.710658   \n",
      "14            88150.809749-0 88150.809748-1         1.887678       -20.312303   \n",
      "15            88150.809749-0 88150.815997-1         1.914321       -20.302480   \n",
      "16       88150.81227499999-0 88150.815997-1         2.205674       -20.620175   \n",
      "17       88150.81599799999-0 88150.815997-1         2.373377       -20.832665   \n",
      "18       88150.81599799999-0 88150.820104-1         2.325815       -20.950335   \n",
      "19            88150.823534-0 88150.820104-1         2.451823       -21.099370   \n",
      "\n",
      "    gaze_point_3d_z  eye_center0_3d_x  ...  eye_center0_3d_z  gaze_normal0_x  \\\n",
      "0        705.121116         20.000000  ...        -20.000000        0.011527   \n",
      "1        684.981621        -39.934928  ...        -20.075283       -0.141761   \n",
      "2        705.232112         20.000000  ...        -20.000000        0.026087   \n",
      "3        683.893108        -39.934928  ...        -20.075283       -0.140397   \n",
      "4        681.151453        -39.934928  ...        -20.075283       -0.136989   \n",
      "5       -334.161525         20.000000  ...        -20.000000        0.041430   \n",
      "6       -316.680240         20.000000  ...        -20.000000        0.052495   \n",
      "7       -298.890441         20.000000  ...        -20.000000        0.065145   \n",
      "8       -288.727225         20.000000  ...        -20.000000        0.065145   \n",
      "9       -289.386597         20.000000  ...        -20.000000        0.065145   \n",
      "10      -286.849309         20.000000  ...        -20.000000        0.067222   \n",
      "11      -286.984799         20.000000  ...        -20.000000        0.067222   \n",
      "12      -288.194181         20.000000  ...        -20.000000        0.066239   \n",
      "13      -288.072115         20.000000  ...        -20.000000        0.066338   \n",
      "14      -288.507800         20.000000  ...        -20.000000        0.066338   \n",
      "15      -288.102445         20.000000  ...        -20.000000        0.066338   \n",
      "16      -289.966778         20.000000  ...        -20.000000        0.064824   \n",
      "17      -291.039161         20.000000  ...        -20.000000        0.063962   \n",
      "18      -291.765325         20.000000  ...        -20.000000        0.063962   \n",
      "19      -292.574406         20.000000  ...        -20.000000        0.063320   \n",
      "\n",
      "    gaze_normal0_y  gaze_normal0_z  eye_center1_3d_x  eye_center1_3d_y  \\\n",
      "0         0.051002        0.998632               NaN               NaN   \n",
      "1         0.192518        0.971000               NaN               NaN   \n",
      "2         0.041811        0.998785               NaN               NaN   \n",
      "3         0.200891        0.969501               NaN               NaN   \n",
      "4         0.220475        0.965725               NaN               NaN   \n",
      "5         0.034837        0.998534        -39.934928         14.997919   \n",
      "6         0.029825        0.998176        -39.934928         14.997919   \n",
      "7         0.027374        0.997500        -39.934928         14.997919   \n",
      "8         0.027374        0.997500        -39.934928         14.997919   \n",
      "9         0.027374        0.997500        -39.934928         14.997919   \n",
      "10        0.026625        0.997383        -39.934928         14.997919   \n",
      "11        0.026625        0.997383        -39.934928         14.997919   \n",
      "12        0.023518        0.997527        -39.934928         14.997919   \n",
      "13        0.023840        0.997512        -39.934928         14.997919   \n",
      "14        0.023840        0.997512        -39.934928         14.997919   \n",
      "15        0.023840        0.997512        -39.934928         14.997919   \n",
      "16        0.024375        0.997599        -39.934928         14.997919   \n",
      "17        0.024893        0.997642        -39.934928         14.997919   \n",
      "18        0.024893        0.997642        -39.934928         14.997919   \n",
      "19        0.025199        0.997675        -39.934928         14.997919   \n",
      "\n",
      "    eye_center1_3d_z  gaze_normal1_x  gaze_normal1_y  gaze_normal1_z  \n",
      "0                NaN             NaN             NaN             NaN  \n",
      "1                NaN             NaN             NaN             NaN  \n",
      "2                NaN             NaN             NaN             NaN  \n",
      "3                NaN             NaN             NaN             NaN  \n",
      "4                NaN             NaN             NaN             NaN  \n",
      "5         -20.075283       -0.145087        0.230744        0.962137  \n",
      "6         -20.075283       -0.145087        0.230744        0.962137  \n",
      "7         -20.075283       -0.145087        0.230744        0.962137  \n",
      "8         -20.075283       -0.153085        0.220988        0.963187  \n",
      "9         -20.075283       -0.152523        0.222659        0.962891  \n",
      "10        -20.075283       -0.152523        0.222659        0.962891  \n",
      "11        -20.075283       -0.152228        0.229814        0.961255  \n",
      "12        -20.075283       -0.152228        0.229814        0.961255  \n",
      "13        -20.075283       -0.152228        0.229814        0.961255  \n",
      "14        -20.075283       -0.151781        0.233679        0.960394  \n",
      "15        -20.075283       -0.152094        0.233980        0.960271  \n",
      "16        -20.075283       -0.152094        0.233980        0.960271  \n",
      "17        -20.075283       -0.152094        0.233980        0.960271  \n",
      "18        -20.075283       -0.151527        0.234143        0.960321  \n",
      "19        -20.075283       -0.151527        0.234143        0.960321  \n",
      "\n",
      "[20 rows x 21 columns]\n"
     ]
    }
   ],
   "source": [
    "df2 = pd.read_csv('/Users/zhengqijia/Downloads/gaze.csv')\n",
    "t=[]\n",
    "for i in df2['gaze_timestamp']:\n",
    "    t.append(i)\n",
    "a=0.01 #100HZ\n",
    "new=[]\n",
    "new.append(t[0])\n",
    "for j in range(1,len(t)):\n",
    "    new.append(new[j-1]+a)\n",
    "df2['gaze_timestamp']=new\n",
    "print(df2[0:20])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "37b2e417",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4c89bf72",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
